/*
 * Copyright (c)  2017
 * All rights reserved.
 * TestController.java 2017-09-13 下午7:32
 */

package com.ueboot.weishop.api.controller;

import com.ueboot.core.http.response.Response;
import com.ueboot.weishop.service.dealer.DealerService;
import com.ueboot.weishop.api.mq.config.QueuesType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 描述:TODO
 *
 * @author yangkui create on 2017-09-13 下午7:32.
 * @since 1.0
 */
@RestController
public class TestController {

    private final Logger logger= LoggerFactory.getLogger (TestController.class);

    @Autowired
    private DealerService dealerService;

    @Autowired
    private AmqpTemplate amqpTemplate;

    @GetMapping("/hello")
    public String hello(){

        return "hello";
    }

    @RequestMapping(value = "/testMQ/{index}", method = RequestMethod.POST)
    public Response<Void> testMQ(@PathVariable String index) {
        amqpTemplate.convertAndSend(QueuesType.ORDER_SUBMIT_SYNC,"orderInfo:"+index);
        return new Response<>();
    }



}